package com.csiec.clock.activity.daka;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.csiec.clock.R;
import com.csiec.clock.adpter.ClockInfoAdapter;
import com.csiec.clock.bean.MyClock;
import com.csiec.clock.bean.People;
import com.csiec.clock.databinding.ActivityClockInfoBinding;
import com.csiec.clock.view.model.ClockInfoViewModel;

import java.util.ArrayList;
import java.util.List;

public class ClockInfoActivity extends AppCompatActivity {

    private final String TAG = ClockInfoActivity.class.getSimpleName();

    private ActivityClockInfoBinding binding;
    private ClockInfoViewModel clockInfoViewModel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = DataBindingUtil.setContentView(this, R.layout.activity_clock_info);

        //接受Intent传来的数据
        Intent intent = getIntent();
        MyClock ownClock = (MyClock) intent.getSerializableExtra("card");

        //LiveData
        clockInfoViewModel = new ViewModelProvider(this).get(ClockInfoViewModel.class);
        binding.setClockInfoViewModel(clockInfoViewModel);
        binding.setLifecycleOwner(this);
        clockInfoViewModel.init(this, binding, ownClock);

    }



}